SPICE Server
2013/01/22 |
Install Desktop Virtualization "SPICE ( Simple Protocol for Independent Computing Environment )".
It's possible to connect to virtual machines from remote client computer.
|
|
[1] | Install SPICE Server. (if need, because generally they are already installed dependency when installing KVM) |
[root@dlp ~]# yum -y install spice-server spice-protocol |
[2] | Edit existing virtual machine's xml-file and start virtual machine with SPICE. This site's example has created virtual machine without graphics, so it's OK to change settings like follows, but if you created virtual machine with graphics, Remove "<graphics>***" and "<video>***" sections in xml file because qxl is used for graphics. |
[root@dlp ~]#
<domain type='kvm'> virsh edit www # edit the configration for a virtual machine "www" <name>www</name> <uuid>9834535e-2549-0a5a-af12-1b78d9ab28c6</uuid> <memory unit='KiB'>2097152</memory> <currentMemory unit='KiB'>2097152</currentMemory> <vcpu placement='static'>2</vcpu> <os> <type arch='x86_64' machine=''pc-1.2'>hvm</type> <boot dev='hd'/> </os> <features> <acpi/> <apic/> <pae/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/qemu-kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='none'/> <source file='/var/kvm/images/www.img'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk> <controller type='usb' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> <interface type='bridge'> <mac address='52:54:00:87:9b:e9'/> <source bridge='br0'/> <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target type='serial' port='0'/> </console> <input type='tablet' bus='usb'/> # add follows ( set any password for "password" section ) <graphics type='spice' port='5930' autoport='no' listen='0.0.0.0' passwd='password'> <listen type='address' address='0.0.0.0'/> </graphics> <video> <model type='qxl' vram='32768' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </memballoon> </devices> </domain> [root@dlp ~]# virsh start www # start VM Domain www started |
[3] | Configuration is all OK. See next page to connect to SPICE server from SPICE client. |
[4] | By the way, if you'd like to configure SPICE when you create a new virtula machine, Set like follows. It's possible to install some OS which requires GUI like Windows without installing Desktop Environment on KVM Host mashine. |
[root@dlp ~]# virt-install \
-n windows \ -r 4096 \ -f /var/kvm/images/windows.img \ -s 50 \ --vcpus=2 \ --os-type windows \ --os-variant=win7 \ --network bridge=br0 \ --graphics spice,port=5940,listen=0.0.0.0,password=password \ --video qxl \ --channel spicevmc \ --cdrom /dev/cdrom |
It's possible to install Windows for a new virtual machine like follows via SPICE. |